package fr.vahren.dotastrat;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import fr.vahren.dotastrat.game.D2SGame;
import fr.vahren.dotastrat.game.D2SGameServer;
import fr.vahren.dotastrat.model.D2SCreepType;
import fr.vahren.dotastrat.model.D2SCreeps;
import fr.vahren.dotastrat.model.D2SHeroUnit;
import fr.vahren.dotastrat.model.D2SPlayer;
import fr.vahren.dotastrat.model.D2SSide;
import fr.vahren.dotastrat.model.D2SUnitClass;
import fr.vahren.dotastrat.model.builder.D2SStatsGen;

public class MainTest {

	public static void main(String[] args) {

		D2SGame game = new D2SGame();

		Map<D2SPlayer, List<D2SHeroUnit>> heroSelection = new HashMap<D2SPlayer, List<D2SHeroUnit>>();

		D2SPlayer p1 = new D2SPlayer(D2SSide.RADIANT);

		D2SPlayer p2 = new D2SPlayer(D2SSide.DIRE);

		D2SHeroUnit es = new D2SHeroUnit("Earthshaker",
				D2SUnitClass.EARTHSHAKER,
				D2SStatsGen.heroStats(D2SUnitClass.EARTHSHAKER), game);
		List<D2SHeroUnit> l1 = new ArrayList<>();
		l1.add(es);

		D2SHeroUnit am = new D2SHeroUnit("Antimage", D2SUnitClass.ANTIMAGE,
				D2SStatsGen.heroStats(D2SUnitClass.ANTIMAGE), game);
		List<D2SHeroUnit> l2 = new ArrayList<>();
		l2.add(am);

		heroSelection.put(p1, l1);
		heroSelection.put(p2, l2);

		game.startNewGame(heroSelection, 1);

		game.getMap().getZone(7).getCreeps()
				.add(new D2SCreeps(D2SCreepType.RADIANT, 0, false));

		game.getMap().getZone(27).getCreeps()
				.add(new D2SCreeps(D2SCreepType.DIRE, 0, false));

		// start server
		D2SGameServer server = new D2SGameServer();
		server.addGame(game);
		server.startServer();

	}
}
